package ly.sjun.design.abstract_factory_pattern.factory;

import ly.sjun.design.abstract_factory_pattern.AbstractFoodFactory;
import ly.sjun.design.abstract_factory_pattern.food.Apple;
import ly.sjun.design.abstract_factory_pattern.food.Cookie;
import ly.sjun.design.abstract_factory_pattern.food.Pear;
import ly.sjun.design.abstract_factory_pattern.food_interface.Biscuit;
import ly.sjun.design.abstract_factory_pattern.food_interface.Fruit;
import ly.sjun.design.abstract_factory_pattern.food_interface.Sugar;


/**
 * @ClassName: BiscuitFactory
 * @Author: ly
 * @Date: 2023/1/4-11:07
 * @Description 饼干工厂
 **/
public class BiscuitFactory extends AbstractFoodFactory {


    @Override
    public Fruit getFruit(String fruit) {
        return null;
    }

    @Override
    public Biscuit getBiscuit(String biscuit) {
        if (biscuit == null || "".equals(biscuit)) {
            return null;
        }
        switch (biscuit) {
            case "cookie":
                return new Cookie();
            default:
                return null;
        }
    }

    @Override
    public Sugar getSugar(String sugar) {
        return null;
    }
}
